/**
 * MasicContainerEvent
 * <p/>
 * User: joakimd
 * Date: 2013-03-11
 * Time: 11:28
 */
package org.dru.masic.event {
import flash.events.Event;

import org.dru.masic.MasicComponent;

public final class MasicContainerEvent extends Event {
    public static const COMPONENT_ADDED: String = "componentAdded";
    public static const COMPONENT_REMOVED: String = "componentRemoved";

    private var _component: MasicComponent;

    public function MasicContainerEvent(type: String, component: MasicComponent, bubbles: Boolean = false, cancelable: Boolean = false) {
        super(type, bubbles, cancelable);
        if (component == null) {
            throw new Error("null component");
        }
        _component = component;
    }

    public function get component(): MasicComponent {
        return _component;
    }
}
}
